{literal}
    <script type="text/javascript">
    function checkForm()
    {
        var PlaylistChecked = jQuery('input[name="playlist[]"]:checked').length;
            if(PlaylistChecked<=0){
                hideAllErrors();
                jQuery("#playlistError").css("display","block");    
                jQuery("#playlistError").focus();   
                return false;
            }else{
                hideAllErrors();
            }
        return true;
    
    }

    function hideAllErrors() 
    {
        jQuery("#playlistError").css("display","none");    
    }
    </script>
{/literal}
<div id="main_wrap">
    <div class="center_wrap clearfix">
        <h2 class="no_bottom no_top breadcrumb">
            <a>Playlists</a>
        </h2>
        {include file="accountmenu.tpl"} 
        <div class="right col1" style="margin:0px;">
            {if $listplaylists|@count gt '0' && $userID neq ''}
                <form method="POST" action="{$formAction}" id="playlistForm" name="playlistForm">
                {/if}  
                <div class="cat_box_full clearfix" id="browse_main"> 
                    {*<p class="right results">{if $error eq ""}{$beginning} - {$ending} {$lang61} {$total} {$lang796}{/if}</p>
                    <ul id="search_nav" class="clearfix">
                    <li class="current">{$showtitle}<span></span></li>
                    </ul>*}
                    <table width="100%" cellspacing="3" cellpadding="3" border="0">
                        <tr>
                            <td valign="top">
                                <h2>View playlists</h2>
                                <div class="uerror" id="playlistError">Error: Please select atleast one playlist to share.</div>
                            </td>
                        </tr>
                        {if $userID neq ""}
                            <tr>
                                <td valign="top">
                                    <a href="{$baseurl}/myplaylist.php">View my playlist</a> &nbsp;
                                    <a href="{$baseurl}/mysharedplaylist.php">View my shared playlist</a>
                                </td>
                            </tr>
                        {/if}
                    </table>	
                    <div class="cat_body_full clearfix">
                        {if $error ne ""}
                            {include file="show_error.tpl"}
                        {/if}
                        {if $message ne ""}
                            {include file="show_message.tpl"}
                        {/if}

                        <!-- LOOP START -->
                        <div id="browse_results">
                            {if $listplaylists|@count gt 0}
                                <ul>
                                    {section name=i loop=$listplaylists}
                                        <li class="video">
                                            <div class="video_i">
                                                <a href="{$baseurl}/view_playlist.php?ID={$listplaylists[i].PLAYLISTID}">
                                                    <img class="imag" height="87" width="116" alt="{$listaudios[i].playlist_title|stripslashes}" src="{$baseurl}/images/tjj_music_dj_headset.png" />
                                                    <div class="tag"></div>
                                                </a>
                                                <a href="{$baseurl}/view_playlist?ID={$listplaylists[i].PLAYLISTID}">
                                                    <span class="artist_name">{$listplaylists[i].playlist_title|stripslashes|truncate:15:"...":true}</span>
                                                </a>
                                                {if $userID neq ""}
                                                Share <input type="checkbox" name="playlist[]" id="{$listplaylists[i].PLAYLISTID}" value="{$listplaylists[i].PLAYLISTID}" />&nbsp;
                                                {/if}
                                            </div>
                                            </il>
                                        {/section}	
                                </ul>

                                <div class="clear"></div>
                            {/if}
                        </div>
                        <!-- LOOP END -->

                    </div>

                    <div class="paginate">
                        {$pagelinks}
                        {*<p class="left">{if $error eq ""}{$beginning} - {$ending} {$lang61} {$total} {$lang796}{/if}</p>*}
                    </div>
                </div>
                {if $listplaylists|@count gt '0' && $userID neq ''}
                    <br />
                    <div class="cat_box_full clearfix" id="browse_main"> 
                        <h2 style="padding-bottom:10px;">Add to my share list</h2>
                            <button id="addtoplaylist" name="addtoplaylist" type="submit" onCLick="return checkForm();">Share</button>
                    </div>
                </form>
            {/if}      
        </div>
        <div class="clear"></div>
    </div>
</div>